Fixup some problems with text length handling in error cases.
authorOwen Taylor <otaylor@redhat.com>
Sat, 23 Jun 2001 14:32:44 +0000 (14:32 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Sat, 23 Jun 2001 14:32:44 +0000 (14:32 +0000)
Sat Jun 23 10:27:53 2001  Owen Taylor  <otaylor@redhat.com>

* modules/input/gtkimcontextxim.c: Fixup some problems with
text length handling in error cases.

* gtk/gtkwidget.c (gtk_widget_size_allocate): Reorder
a bit to make test actually warn on attempt to allocation
a negative size. (#56101, Matthias Clasen)

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkwidget.c
modules/input/gtkimcontextxim.c

index fa8adf814462bc42fe28e16ceeb52dffbd2c0645..094419983f9fd99082a855d082fdc9631da3f7cb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Sat Jun 23 10:27:53 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * modules/input/gtkimcontextxim.c: Fixup some problems with 
+       text length handling in error cases.
+
+       * gtk/gtkwidget.c (gtk_widget_size_allocate): Reorder
+       a bit to make test actually warn on attempt to allocation
+       a negative size. (#56101, Matthias Clasen)
+
 Fri Jun 22 14:06:08 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): Fix bug
index fa8adf814462bc42fe28e16ceeb52dffbd2c0645..094419983f9fd99082a855d082fdc9631da3f7cb 100644 (file)
@@ -1,3 +1,12 @@
+Sat Jun 23 10:27:53 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * modules/input/gtkimcontextxim.c: Fixup some problems with 
+       text length handling in error cases.
+
+       * gtk/gtkwidget.c (gtk_widget_size_allocate): Reorder
+       a bit to make test actually warn on attempt to allocation
+       a negative size. (#56101, Matthias Clasen)
+
 Fri Jun 22 14:06:08 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): Fix bug
index fa8adf814462bc42fe28e16ceeb52dffbd2c0645..094419983f9fd99082a855d082fdc9631da3f7cb 100644 (file)
@@ -1,3 +1,12 @@
+Sat Jun 23 10:27:53 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * modules/input/gtkimcontextxim.c: Fixup some problems with 
+       text length handling in error cases.
+
+       * gtk/gtkwidget.c (gtk_widget_size_allocate): Reorder
+       a bit to make test actually warn on attempt to allocation
+       a negative size. (#56101, Matthias Clasen)
+
 Fri Jun 22 14:06:08 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): Fix bug
index fa8adf814462bc42fe28e16ceeb52dffbd2c0645..094419983f9fd99082a855d082fdc9631da3f7cb 100644 (file)
@@ -1,3 +1,12 @@
+Sat Jun 23 10:27:53 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * modules/input/gtkimcontextxim.c: Fixup some problems with 
+       text length handling in error cases.
+
+       * gtk/gtkwidget.c (gtk_widget_size_allocate): Reorder
+       a bit to make test actually warn on attempt to allocation
+       a negative size. (#56101, Matthias Clasen)
+
 Fri Jun 22 14:06:08 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): Fix bug
index fa8adf814462bc42fe28e16ceeb52dffbd2c0645..094419983f9fd99082a855d082fdc9631da3f7cb 100644 (file)
@@ -1,3 +1,12 @@
+Sat Jun 23 10:27:53 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * modules/input/gtkimcontextxim.c: Fixup some problems with 
+       text length handling in error cases.
+
+       * gtk/gtkwidget.c (gtk_widget_size_allocate): Reorder
+       a bit to make test actually warn on attempt to allocation
+       a negative size. (#56101, Matthias Clasen)
+
 Fri Jun 22 14:06:08 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): Fix bug
index fa8adf814462bc42fe28e16ceeb52dffbd2c0645..094419983f9fd99082a855d082fdc9631da3f7cb 100644 (file)
@@ -1,3 +1,12 @@
+Sat Jun 23 10:27:53 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * modules/input/gtkimcontextxim.c: Fixup some problems with 
+       text length handling in error cases.
+
+       * gtk/gtkwidget.c (gtk_widget_size_allocate): Reorder
+       a bit to make test actually warn on attempt to allocation
+       a negative size. (#56101, Matthias Clasen)
+
 Fri Jun 22 14:06:08 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): Fix bug
index fa8adf814462bc42fe28e16ceeb52dffbd2c0645..094419983f9fd99082a855d082fdc9631da3f7cb 100644 (file)
@@ -1,3 +1,12 @@
+Sat Jun 23 10:27:53 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * modules/input/gtkimcontextxim.c: Fixup some problems with 
+       text length handling in error cases.
+
+       * gtk/gtkwidget.c (gtk_widget_size_allocate): Reorder
+       a bit to make test actually warn on attempt to allocation
+       a negative size. (#56101, Matthias Clasen)
+
 Fri Jun 22 14:06:08 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): Fix bug
index 2ebaa48dbbdde4cea023419c23da629499ae7c4a..8dee4378291db31a0ac784a11fdfe721f181ea06 100644 (file)
@@ -2275,18 +2275,16 @@ gtk_widget_size_allocate (GtkWidget     *widget,
        real_allocation.y = aux_info->y;
     }
 
-  real_allocation.width = MAX (real_allocation.width, 1);
-  real_allocation.height = MAX (real_allocation.height, 1);
-
   if (real_allocation.width < 0 || real_allocation.height < 0)
     {
       g_warning ("gtk_widget_size_allocate(): attempt to allocate widget with width %d and height %d",
                 real_allocation.width,
                 real_allocation.height);
-      real_allocation.width = 1;
-      real_allocation.height = 1;
     }
   
+  real_allocation.width = MAX (real_allocation.width, 1);
+  real_allocation.height = MAX (real_allocation.height, 1);
+
   if (GTK_WIDGET_NO_WINDOW (widget))
     {
       if (widget->allocation.x != real_allocation.x ||
index e1e81adec1950b74f6a064bd3886d86357a64faf..6f4e4f4a0a4bfde1f6301fd47b15f4b7c2155258 100644 (file)
@@ -607,7 +607,7 @@ xim_text_to_utf8 (GtkIMContextXIM *context, XIMText *xim_text, gchar **text)
                          -1,
                          "UTF-8",
                          context->mb_charset,
-                         NULL, &text_length,  &error);
+                         NULL, NULL, &error);
       
       if (result)
        {
@@ -622,6 +622,9 @@ xim_text_to_utf8 (GtkIMContextXIM *context, XIMText *xim_text, gchar **text)
        {
          g_warning ("Error converting text from IM to UCS-4: %s", error->message);
          g_error_free (error);
+
+         *text = NULL;
+         return 0;
        }
 
       *text = result;